home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / wnos5src.zip / ENET.H < prev    next >
Text File  |  1993-08-09  |  1KB  |  53 lines

  1. #ifndef    _ENET_H
  2. #define _ENET_H
  3.  
  4. /* Generic Ethernet constants and templates */
  5. #ifndef    _GLOBAL_H
  6. #include "global.h"
  7. #endif
  8.  
  9. #ifndef    _MBUF_H
  10. #include "mbuf.h"
  11. #endif
  12.  
  13. #ifndef    _IFACE_H
  14. #include "iface.h"
  15. #endif
  16.  
  17. #define    EADDR_LEN    6
  18. /* Format of an Ethernet header */
  19. struct ether {
  20.     char dest[EADDR_LEN];
  21.     char source[EADDR_LEN];
  22.     int16 type;
  23. };
  24. #define    ETHERLEN    14
  25.  
  26. /* Ethernet broadcast address */
  27. extern char Ether_bdcst[];
  28.  
  29. /* Ethernet type fields */
  30. #define    IP_TYPE        0x800    /* Type field for IP */
  31. #define    ARP_TYPE    0x806    /* Type field for ARP */
  32. #define    REVARP_TYPE    0x8035    /* Type field for reverse ARP */
  33.  
  34. #define    RUNT        60    /* smallest legal size packet, no fcs */
  35. #define    GIANT        1514    /* largest legal size packet, no fcs */
  36.  
  37. #define    MAXTRIES    16    /* Maximum number of transmission attempts */
  38.  
  39. /* In file enet.c: */
  40. char *pether __ARGS((char *out,char *addr));
  41. int gether __ARGS((char *out,char *cp));
  42. int enet_send __ARGS((struct mbuf *bp,struct iface *iface,int32 gateway,int prec,
  43.     int del,int tput,int rel));
  44. int enet_output __ARGS((struct iface *iface,char dest[],char source[],int16 type,
  45.     struct mbuf *data));
  46. void eproc __ARGS((struct iface *iface,struct mbuf *bp));
  47.  
  48. /* In enethdr.c: */
  49. struct mbuf *htonether __ARGS((struct ether *ether,struct mbuf *data));
  50. int ntohether __ARGS((struct ether *ether,struct mbuf **bpp));
  51.  
  52. #endif    /* _ENET_H */
  53.